package com.lanou3g.ptp.signInDate.mapper;

import com.lanou3g.ptp.entity.SignInDate;
import com.lanou3g.ptp.vo.CentralTaskResult;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Mapper
public interface SignInDateMapper {

    List<SignInDate> findAll();

    SignInDate findById(Long id);

    void insertAll(List<SignInDate> signInDates);

    void insert(SignInDate signInDate);

    void delete(Long id);

    void deletes(Long[] ids);

    void update(@Param("id") Long id,@Param("s") SignInDate signInDate);

    void deleteByTaskId(Long taskId);

    List<SignInDate> findSignTime(Long taskId);

    void deletesByTaskIds(Long[] ids);

    List<Date> findDetailsByTaskId(Long taskId);

    Integer checkTimes(@Param("taskId") Long taskId, @Param("today") Date today);

    /**
     *
     * @param taskId 任务id
     * @param now 当前时间
     * @param total 应该完成打卡的总次数
     * @return
     */
    List<CentralTaskResult.Student> findStudentDetails(
            @Param("taskId") Long taskId,
            @Param("now") Date now,
            @Param("total") Integer total
    );
}
